package com.ruitaowang.core.utils;

import javassist.ClassPool;
import javassist.CtClass;
import javassist.CtMethod;

/**
 * Created by neal on 20/01/2017.
 */
public class CharlesFk {
    public static void main(String[] args) throws Exception{
//
//        ClassPool classPool= ClassPool.getDefault();
//        classPool.insertClassPath("/Users/neal/work/bitbucket.org/ruitao-server-side/charles.jar"); //复制出来charles.jar的文件路径
//
//        CtClass ctClass = classPool.get("com.xk72.charles.License");
//        CtMethod ctMethod =ctClass.getDeclaredMethod("a",null);
//        ctMethod.setBody("{return true;}");
//        ctMethod = ctClass.getDeclaredMethod("b",null);
//        ctMethod.setBody("{return \"Regisered Name\";}");
//        ctClass.writeFile();

        //jar uvf charles.jar com/xk72/charles/License.class
    }
}
